package com.rimi.service.impl;

import com.rimi.bean.YqzcInvoice;
import com.rimi.commons.CommonResult;
import com.rimi.commons.ResultStatus;
import com.rimi.mapper.InvoiceMapper;
import com.rimi.service.InvoiceService;
import com.rimi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author 罗晨
 * @version V1.0
 * @Description: 用一句话描述该文件做什么
 * @date 2021 2021/7/8 14:42
 */
@Service
public class InvoiceServiceImpl implements InvoiceService {

    @Autowired
    InvoiceMapper invoiceMapper;

    @Autowired
    UserService userService;

    @Override
    public YqzcInvoice queryInvoiceById(YqzcInvoice yqzcInvoice) {

        return invoiceMapper.queryInvoiceById(yqzcInvoice);
    }

    @Override
    public CommonResult addInvoiceById(Integer id, YqzcInvoice yqzcInvoice) {

        int row =invoiceMapper.addInvoiceById(id,yqzcInvoice);

        return row==1?CommonResult.onSuccess(null):CommonResult.onFailed(ResultStatus.INVOICE_FAILED);
    }
}
